<script type="text/javascript">

    	$(document).ready(function(){		
    		getDatePicker('expiry_day');	
    	});
    	
    	// datepicker
    	function getDatePicker(_id) {	
    	$("#"+_id).datepicker({
    		 showOn:'button',
    		 dateFormat:"yy-mm-dd",
    		 buttonImage:'<?php echo $this->baseUrl(); ?>'+'/public/templates/admin/js/calendar/images/calendar.gif',
    		 buttonImageOnly:true,
    		 yearRange: '2000:2020',
    		 changeMonth:true,
    		 changeYear:true,
    		 showMonthAfterYear: true
    		 //minDate:0
    	   });
    	 }
</script>

<div class="heading">
    <div class="left_heading"></div>
                                
    <div class="content_heading">
        <h3>Thông tin thành viên</h3>
    </div>
                                
    <div class="right_heading"></div>
</div><!-- End .heading -->

<div class="main_content">
    <div class="table_form">      
        <form class="list_cat_form" action="" method="post" enctype="multipart/form-data">
        <div style="float: left;">
        <table class="table_adduser" cellpadding="5"> 
            <tr>
                <td>Thông tin cá nhân</td>
            </tr>
            <tr>
                <td class="label">Email</td>
                <td class="label2"><?php echo $this->email ?></td>
                <td><span class="msg" id="errname"></span></td>
            </tr> 
            <tr>
                <td class="label">Họ tên</td>
                <td class="label2"><input class="input" type="text" size="30" name="name" value="<?php echo $this->name; ?>" id="name" onchange="return validate_name()" /></td>
                <td ><span class="msg" id="errname"><?php echo $this->errname?></span></td>
            </tr>        
            
            <tr>
                <td>Số điện thoại</td>
                <td><input type="text" class="input" size="30" name="phone" value="<?php echo $this->phone; ?>" id="phone" onchange="return validate_phone()" /></td>
                <td><span class="msg" id="errphone"><?php echo $this->errphone?></span></td>
            </tr>
            <tr>
                <td>Ngày sinh</td>
                <td><input class="input" type="text" size="30" name="birthday" id="expiry_day"  value="<?php echo $this->birthday; ?>"/></td>
                <td><span class="msg" ><?php echo $this->errbirthday?></span></td>
            </tr>
             <tr>
                <td>Giới tính</td>
                <?php if(($this->gender)==1): ?>
                <td>
                    <select class="input" name="gender" id="role">
				        <option value="1" selected="selected">Nam</option>
    				    <option value="0">Nữ</option>
				    </select>
                </td>
                <?php else: ?>
                <td>
                    <select class="input" name="gender" id="role">
				        <option value="1">Nam</option>
    				    <option value="0" selected="selected">Nữ</option>
				    </select>
                </td>
                <?php endif ?>
            </tr> 
            <tr>
                <td class="label">Ảnh đại diện</td>
                
                <td>
                <?php if($this->avatar!=''): ?>
                        <img class="img_avatar" width="60px" height="50px" src="<?php echo $this->baseUrl('/public/img/user/'.$this->avatar) ?>"/>
                    <?php else:?>                       
                        <img class="img_avatar" width="60px" height="50px" src="<?php echo $this->baseUrl('/public/img/user/default.jpg') ?>"/>
                    <?php endif;  ?>
                    <input type="file" name="file" />
                </td>
            </tr>    
            <tr>
                <td>
                    Quyền quản trị <span class="msg"> * </span>
                </td>
                <td>
                    <select class="input" name="role">
    				    <?php foreach ($this->role as $row){
    				        if($row['role_id'] == $this->role_id) {
    				            echo'<option value="'.$row["role_id"].'" selected="selected">'.$row["role_name"].'</option>';
    				        }
                            else {
                                echo'<option value="'.$row["role_id"].'">'.$row["role_name"].'</option>';
                            }
    				    }?>
				    </select>
                </td>
                <td><span class="msg"><?php echo $this->errrole?></span></td>
            </tr>
                
            <tr>
                <td colspan="2"><?php echo $this->err ?></td>
            </tr>
            <tr>
				<td class="label"></td>
				<td colspan="2">
					<input class="button" type="submit" name="submit" value="Cập nhật"/>
					<input class="button" type="reset" name="reset" value="Nhập lại"/>
					<a href="<?php echo $this->baseUrl('admin/user'); ?>" class="button" style="padding-top: 7px;">Quay lại</a>
				</td>
			</tr>
            <tr>
                <td colspan="2" id="error">&nbsp;</td>
            </tr>
        </table>
        
        </div>
        </form>
    
</div><!-- End .main_content -->  